﻿<html>
	<head>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<!--Fireworks MX 2004 Dreamweaver MX 2004 target.  Created Fri Nov 26 17:52:24 GMT+0800 2010-->
		<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	background-color: #FFF;
}

body table tr td table tr td table tr td table tr td a {
	text-decoration: none;
	color: #069;
	font-family: "微软雅黑";
	font-weight: normal;
	font-size: 14px;
}

.quandianping1 {
	padding-bottom: 5px;
	padding-top: 5px;
	font-size: 12px;
}

.quandianping {
	padding-bottom: 5px;
	padding-top: 5px;
}
-->
</style>
		<SCRIPT LANGUAGE="JavaScript" src="pro.js"></SCRIPT>
		<script language="javascript">
var temp="br1";
var hidtemp="br11";
function changeBr(imageName)
{	
	temp1=document.getElementById(temp);
    temp1.src="../../resource/img/index/"+temp+".jpg";
	imageName1=document.getElementById(imageName);
	imageName1.src="../../resource/img/index/"+imageName+"1.jpg";
	temp=imageName;
	hidtemp1=document.getElementById(hidtemp);
	hidtemp1.style.display="none";
	imageName2=document.getElementById(imageName+"1");	
	imageName2.style.display="";
	hidtemp=imageName+"1";
	btn=document.getElementById("btn");
	if (imageName == "br5")
	btn.style.display="none";
	else btn.style.display="";
}
</script>
		<script src="../../resource/js/jquery-1.4.2.js"></script>
		<link href="../../resource/css/pagination2.css" rel="stylesheet"
			type="text/css" />
		<script src="../../resource/js/pagination2.js"></script>
	</head>
	<body>
		<div id="bbbbform">
		<form name="form1" target="pingjiaFrame" method="post" action="../../pingjia/saveOrUpdate.shtml" >
			<table width="100%" border="0" cellspacing="0" cellpadding="0" id="bbbb1">
				<tr>
					<td>
						<div id="messageList">
						<table width="98%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<table width="100%" border="0" cellpadding="0" cellspacing="1"
										bgcolor="#D9D9D9">
										<tr>
											<td height="30" bgcolor="#F0F0F0">
												<table width="100%" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td width="26" height="18" align="center">
															<a href="#" onClick="return IndexDeploy('1',0)"><img
																	src="../../resource/img/index/cate_open.gif"
																	name="img_1" width="15" height="15" border="0"
																	id="img_1">
															</a>
														</td>
														<td valign="bottom">
															<a href="#" onClick="return IndexDeploy('1',0)">电伴热系统设计、安装、调试和维护</a>
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tbody id="cate_1" style="display: none">
											<tr>
												<td bgcolor="#F7F7F1">
													<table width="100%" border="0" cellspacing="2"
														cellpadding="0">
														<tr>
															<td width="4%" height="30" align="left" valign="top">
																<img src="../../resource/img/index/irow_o_r.gif" />
															</td>
															<td width="96%" align="left" valign="top"
																class="paragraph"
																style="line-height: 25px; font-size: 12px">
																dfsdfsdfsdfsdfsdfdsfsdfsdfewrtrfsdfdfsdfwertfgsdfsdetfsdfsetgsdfewgsdfsdfew
															</td>
														</tr>


													</table>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</table>
						<br>
						<table width="98%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<table width="100%" border="0" cellpadding="0" cellspacing="1"
										bgcolor="#D9D9D9">
										<tr>
											<td height="30" bgcolor="#F0F0F0">
												<table width="100%" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td width="26" height="18" align="center">
															<a href="#" onClick="return IndexDeploy('2',0)"><img
																	src="../../resource/img/index/cate_open.gif"
																	name="img_1" width="15" height="15" border="0"
																	id="img_2">
															</a>
														</td>
														<td valign="bottom">
															<a href="#" onClick="return IndexDeploy('2',0)">电伴热系统设计、安装、调试和维护</a>
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tbody id="cate_2" style="display: none">
											<tr>
												<td bgcolor="#F7F7F1">
													<table width="100%" border="0" cellspacing="2"
														cellpadding="0">
														<tr>
															<td width="4%" height="30" align="left" valign="top">
																<img src="images/irow_o_r.gif" />
															</td>
															<td width="96%" align="left" valign="top"
																class="paragraph"
																style="line-height: 25px; font-size: 12px">
																&nbsp;
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</table>
						</div>
					</td>
				</tr>
			</table>
			<br>
			<div id="pagnation"></div>
			<table width="610" border="0" cellspacing="0" cellpadding="0" id="bbbb2" style="margin-top: 30px;">
				<tr>
					<td align="right" width="75">
						<div class="quandianping1">
							<label for="select">
								评价：
							</label>
						</div>
					</td>
					<td align="left">

						<div class="quandianping">
							<select name="pg.type" id="type">
								<option selected value="-1">
									-请选择-
								</option>
								<option value="1">
									好评
								</option>
								<option value="2">
									差评
								</option>
							</select>
							<em style="color: #F00">*</em>
						</div>
					</td>
				</tr>
				<tr>
					<td align="right">
						<div class="quandianping1">
							<label for="textfield2">
								标题：
							</label>
						</div>
					</td>
					<td align="left">
						<div class="quandianping">
							<input type="text" name="pg.title" id="title" />
							<em style="color: #F00">*</em>
						</div>
					</td>
				</tr>
				<tr>
					<td align="right" valign="top">
						<div class="quandianping1">
							<label for="textarea">
								内容：
							</label>
						</div>
					</td>
					<td align="left">
						<div class="quandianping">
							<textarea name="pg.content" id="content" cols="60" rows="11"></textarea>
							<br />
							<span style="line-height: 25px"></span>
						</div>
					</td>
				</tr>
				<tr>
					<td width="75">
						<div class="quandianping1"></div>
					</td>
					<td>
						<div class="quandianping">
							<input name="pg.yeId" id="yeId" type="hidden"/>
							<input name="pg.brandId" id="brandId" type="hidden"/>
							<input type="button" onclick="pingjia();" name="button" id="button" value="提交">
						</div>
					</td>
				</tr>
			</table>
		</form>
		</div>
		<iframe style="display: none" name="pingjiaFrame"></iframe>
	</body>
	<script type="text/javascript">
	var selfUri = window.location.href;
	var bid = selfUri.substring(selfUri.indexOf('?')+1);
	$("#brandId").val(bid);
	var yeid = parent.parent.userid;
	$("#yeId").val(yeid);
	var yetype = parent.parent.userType;
	$(function(){
		topage(1,10);
	})

function topage(pageNo,limit){
	$.get('../../brand/brandPingJia.shtml?id='+bid+'&pageNo='+pageNo+'&limit='+limit,function(mes){
			jQuery("#messageList").html('');
			var jsonMes = eval('('+mes+')');
			var str = '';
			var json = jsonMes[0]['list'];
			var count = jsonMes[0]['totalRecords'];
			if(json != '')
				for(var i = 0; i < json.length; i++){
					str += '<table width="98%" border="0" cellspacing="0" cellpadding="0">'+
								'<tr><td style="border-bottom:1px solid #6DC6EB"><table width="100%" border="0" cellpadding="0" cellspacing="1" >'+
											'<tr><td height="30" ><table width="100%" border="0" cellspacing="0" cellpadding="0">'+
														'<tr><td width="26" height="18" align="center">'+
																'<a href="#" onClick="return IndexDeploy(\''+(i+1)+'\',0)"><img '+
																		'src="../../resource/img/index/cate_open.gif" '+
																		'name="img_'+(i+1)+'" width="15" height="15" border="0" '+
																		'id="img_'+(i+1)+'" style="display:none"> '+
																		'<img '+
																		'src="../../resource/img/index/unt.bmp" '+
																		'name="img_'+(i+1)+'" width="15" height="15" border="0" '+
																		' > '+
																'</a> '+
															'</td>'+
															'<td valign="bottom">'+
																'<a href="#" onClick="return IndexDeploy(\''+(i+1)+'\',0)">'+json[i]['title']+'</a>'+
															'</td>'+
														'</tr>'+
													'</table>'+
												'</td>'+
											'</tr>'+
											'<tbody id="cate_'+(i+1)+'" style="display: none">'+
												'<tr>'+
													'<td >'+
														'<table width="100%" border="0" cellspacing="2"'+
															'cellpadding="0">'+
															'<tr>'+
																'<td width="4%" height="30" align="left" valign="top">'+
																	'&nbsp;&nbsp;&nbsp;&nbsp;'+
																'</td>'+
																'<td width="96%" align="left" valign="top" '+
																	'class="paragraph" '+
																	'style="line-height: 25px; font-size: 12px"> '+
																	json[i]['content']+
																'</td> '+
															'</tr> '+
														'</table> '+
													'</td>'+
												'</tr>'+
											'</tbody>'+
										'</table>'+
									'</td>'+
								'</tr>'+
							'</table>'+
							'<br>';
												
				}
			jQuery("#messageList").html(str);
			if(count>0){
					pagination({
						totalRecords:count,
						pageNo:pageNo,
						limit:limit,
						showPages:6,
						uri:function(pageNo,limit){
							topage(pageNo,limit);
						},
						id:'pagnation'
					})
			}
		})
}
var joinFlag = parent.parent.joinFlag;
function pingjia(){
	if(yeid == ''){
  		alert('您还未登录，请先登录!');
  		return;
  	}
  	if(yetype != '3'){
  		alert('只有业主才可以进行评价!');
  		return;
  	}
  	if('true' != joinFlag){
  		alert('只有购买过此商品的业主才可以进行评价!');
  		return;
  	}
	var  type=$("#type").val();
       if("-1"==type)
       {
          alert('请选择评价态度');
          $("#type").focus();
         return;
       }
       var  title=$("#title").val();
       if(""==title){
          alert("请选择标题");
          $("#title").focus();
          return;
       }
       var content =$("#content").val();
        if(""==content){
          alert("请填写评价内容");
          $("#content").focus();
          return;
       }
       document.forms[0].submit();
}
function addResult(mes){
	if(mes == '1'){
		alert('评价成功');
		$("#title").val("");
		$("#content").val("");
		topage(1,15);
	}else{
		alert('评价失败');
	}
}
function initHeight(){
	parent.initIframeHeight(jQuery('body').height());
}

parent.initIframeHeight(1300);
</script>
</html>
